#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
文件名: data.py
功能: 存放用例初始变量
作者: windows
创建日期: 2025/7/22
版本: 1.0
"""


class GlobalVariable:
    _instance = None

    def __new__(cls):
        if cls._instance is None:
            cls._instance = super(GlobalVariable, cls).__new__(cls)
            cls._instance.__initialized = False
        return cls._instance

    def __init__(self):
        if self.__initialized:
            return
        self.__initialized = True

        self.pass_list = []
        self.fail_list = []
        self.skip_list = []

        self.request_result_dict = {}
        self.respond_result_dict = {}


if __name__ == '__main__':
    a = GlobalVariable()
    a.pass_list.append('pass')
    a.pass_list.append('pass')
    a.pass_list.append('pass')
    b = GlobalVariable()
    print(b.pass_list)
    # print(a is b)  # 输出 True，表示是同一个实例